<!--#include file="AspCms_OrderFun.asp" -->
<!DOCTYPE html>
<html lang="zh-CN" style="min-height: 100%;">
<head>
<title>OrderInfo</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />

<link href="https://cdn.bootcss.com/uikit/3.0.0-beta.22/css/uikit.min.css" rel="stylesheet">
<link href="../../css/timoo/timoo-print.css" rel="stylesheet">

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit.min.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit-icons.min.js"></script>
<script src="../../js/timoo/timoo.js"></script>
<%
Dim m_orderno,sql,rs

m_orderno = getForm("OrderNo","both")

sql = "select {prefix}Order2.*,(select sum(count) from {prefix}OrderProduct where {prefix}OrderProduct.orderno={prefix}Order2.orderno) as pcount,(select sum(InstantPrice*[Count]) from {prefix}OrderProduct where {prefix}OrderProduct.orderno={prefix}Order2.orderno) as pprice from {prefix}Order2 where orderno = '"&m_orderno&"'"
Set rs = Conn.exec(sql,"r1")

if rs.eof or rs.bof then 
	die "未找到订单号" & m_orderno
end if

%>
</head>
<body>
<div class="uk-container print-box">
    <div class="uk-text-center title">
        <span class="company-name"><%=setting.companyName%></span>发货单
    </div>
    <div class="buyer">
        <ul class="uk-grid clearfix">
            <li class="uk-width-1-3">
                <span class="subject">用户昵称：</span>
                <span class="info"><%=rs("UserName")%></span>
            </li>
            <li class="uk-width-1-3">
                <span class="subject">下单日期：</span>
                <span class="info"><%=FormatDate(rs("OrderTime"), "yy-m-d h:mi:s")%></span>
            </li>
            <li class="uk-width-1-3 uk-text-right">
                <span class="subject">订单号：</span>
                <span class="info"><%=m_orderno%></span>
            </li>
            <li class="uk-width-1-3">
                <span class="subject">收货姓名：</span>
                <span class="info"><%=rs("nicename")%></span>
            </li>
            <li class="uk-width-2-3">
                <span class="subject">联系电话：</span>
                <span class="info"><%=rs("mobile")%></span>
                <span class="info"><%=rs("phone")%></span>
            </li>
            <li class="uk-width-1-1">
                <span class="subject">收货地址：</span>
                <span class="info"><%=rs("province")%>-<%=rs("city")%>-<%=rs("area")%>-<%=rs("address")%></span>
            </li>
        </ul>
    </div>
    <div class="uk-text-center print-table">
        <table class="uk-table uk-table-divider">
            <thead>
                <tr>
                    <th>序号</th>
                    <!--<th>商品图片</th>-->
                    <th>商品名称</th>
                    <th>商品单价（元）</th>
                    <th>商品数量</th>
                    <th>总计金额（元）</th>
                </tr>
            </thead>
            <tbody>
                <%
                   Dim prs,i,allnum
                   i=1
                   allnum=0
                   sql = "select op.count,op.InstantPrice,op.productid,a.title,a.IndexImage from AspCms_OrderProduct as op, AspCms_content as a where contentid=op.productid and orderno='"&m_orderno&"'"
                   set prs = conn.exec(sql,"r1")
                   while not prs.eof
                %>
                <tr>
                    <td><%=i%></td>
                    <!--<td><img src='<%=prs("IndexImage")%>'></td>-->
                    <td><%=prs("title")%></td>
                    <td><%=FormatNumber(prs("InstantPrice"),2)%></td>
                    <td><%=prs("count")%></td>
                    <td><%=FormatNumber(prs("count")*prs("InstantPrice"),2)%></td>
                </tr>
                <%  
                   allnum=allnum+prs("count")
                   i=i+1
                   prs.movenext
                   wend
                   prs.close
                   set prs = nothing
                %>
            </tbody>
            <tfoot>
                <tr>
                    <td>合计：</td>
                    <td colspan="2">&nbsp;</td>
                    <td><%=allnum%></td>
                    <td><%=FormatNumber(rs("pprice"),2)%></td>
                </tr>
            </tfoot>
        </table>
    </div>
    <div class="message">
        <span class="subject">买家留言：</span>
        <span class="info"><%=rs("note")%></span>
    </div>
    <div class="tips">
        <span class="subject">卖家备注：</span>
        <span class="info"><input type="text" placeholder="暂无卖家备注信息"></span>
    </div>
    <div class="touching">
        <ul class="uk-grid">
            <li class="uk-width-2-5">
                <span class="subject">制单：</span>
                <span class="info"><input type="text" value="<%=setting.companyName%>"></span>
            </li>
            <li class="uk-width-1-5">
                <span class="subject">客服电话：</span>
                <span class="info"><input type="text" value="<%=setting.companyPhone%>"></span>
            </li>
            <li class="uk-width-1-5">
                <span class="subject">发货时间：</span>
                <span class="info"><input type="text" value="<%=now()%>"></span>
            </li>
            <li class="uk-width-1-5 uk-text-right">
                <span class="subject">审核人：</span>
                <span class="info"><input type="text" value=""></span>
            </li>
        </ul>
    </div>
    <div class="uk-text-center button">
        <a href="Aspcms_OrderFun.asp?action=print&orderno=<%=m_orderno%>&s=1" target="p" onclick="window.print()">打印</a>
    </div>
</div>
</body>
</html>
<%rs.close:set rs = nothing%>